home *** CD-ROM | disk | FTP | other *** search
- .model tiny
- .code
- Jumps
-
- ORG 100H
-
- start: JMP begin
-
- ;******************************************************************************
- Patch dw data1,data2,data3,0
-
- data1 dd 2E3CCh
- dw 5
- db 90h,0EBh,5Ah,0EBh,58h
-
- data2 dd 37BBBh
- dw 6
- db 0B3h,00,66h,51h,8Ah,0Dh
-
- data3 dd 37BCBh
- dw 4
- db 66h,59h,0EBh,02
-
- logo DB 'Cracker for Network Q Rally',0AH,0DH
- DB '~~~~~~~~~~~~~~~~~~~~~~~~~~~',0AH,0DH
- DB '$'
-
- Ok DB 'Ok! RallyC are now cracked!',10,13,'$'
-
- notfound DB 'FILE NOT FOUND',0AH,0DH
- DB 'Make sure you start CRACK.COM in the same '
- DB 'directory as '
- FileName DB 'RAL.EXE',0 ;the name of the file to be patched
- DB ,0AH,0DH,'$'
-
- fatal DB 'A fatal error has occured',0AH,0DH
- DB 'the crack was not applied',0AH,0DH
- DB '$'
-
- handle DW 0
- attr dw 0
- ;******************************************************************************
- ; this procedure type error message and exit program
- ;******************************************************************************
-
- Error: lea dx,NotFound
- cmp ax,2
- je TypeMSG
- lea dx,Fatal
- TypeMSG: mov ah,9
- int 21h
- mov ax,4C01h
- int 21h
-
- ;******************************************************************************
- ; this procedure opens the file to be cracked
- ;******************************************************************************
-
- open_it proc near
-
- lea dx,FileName
- mov ax,4300h
- int 21h ;get file attr
- mov [Attr],cx
- jc Error
-
- and cx,0FFFEh ;clear ReadOnly bit
- mov ax,4301h
- int 21h ;set file attr
- jc Error
-
-
- lea dx,FileName
- mov ax,3d02h
- int 21h
- jc Error ;open file to be cracked
-
- mov Handle,ax ;store the file handle for
- ret ;use later and return
-
- open_it endp
-
- ;******************************************************************************
- ; this procedure writes the crack to the file
- ;
- ;******************************************************************************
-
- patch_it proc near
-
- mov dx,[di]
- mov cx,[di+2]
- mov ah,42h ;setup to move the file
- mov al,00h ;pointer to the patch site
- mov bx,[Handle] ;load the file handle
- int 21h ;move the pointer
- jc Error
-
- mov cx,[di+4]
- mov dx,di
- add dx,6
- mov ah,40h ;setup to write the crack
- mov bx,[Handle] ;load file handle
- int 21h ;make the patch
- jc Error
- ret
-
- patch_it endp
-
- ;******************************************************************************
- ; this procedure close file
- ;******************************************************************************
-
- close_it proc near
-
- mov bx,[Handle] ;load file handle
- mov ah,3eh
- int 21h ;close file and return
-
- lea dx,FileName
- mov cx,[Attr]
- mov ax,4301h
- int 21h ;restore file attr
- ret
-
- close_it endp
-
- ;******************************************************************************
- ; the main program
- ;******************************************************************************
-
- begin proc near
-
- mov ah,09h
- lea dx,Logo ;display logo
- int 21h
-
- call open_it ;open file to be patched
-
- lea si,Patch
-
- Next: mov di,[si]
- add si,2
- or di,di
- jz _End
- call patch_it ;make the patch
- jmp Next
- _End:
- call close_it
-
- mov ah,09h
- lea dx,Ok ;display ok
- int 21h
-
- mov ax,4C00h ;exit
- int 21h
-
- begin ENDP
-
- END START
-